<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 人员管理控制器
 */
class Personnel extends AdminBase
{
    
    /**
     * 人员管理列表
     */
    public function personnelList()
    {
        
        $this->assign('list', $this->logicPersonnel->getPersonnelList());
        
        return $this->fetch('personnel_list');
    }
    
   

    /**
     * 人员管理添加
     */
    public function personnelAdd()
    {
        
        IS_POST && $this->jump($this->logicPersonnel->personnelAdd($this->param));
        
        return $this->fetch('personnel_add');
    }
    
    /**
     * 人员管理编辑
     */
    public function personnelEdit()
    {
        
        IS_POST && $this->jump($this->logicPersonnel->personnelEdit($this->param));
        
        $info = $this->logicPersonnel->getPersonnelInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('personnel_edit');
    }
    
    /**
     * 人员管理删除
     */
    public function personnelDel($id = 0)
    {
        
        $this->jump($this->logicPersonnel->personnelDel(['id' => $id]));
    }

    /**
     * 修改密码
     */
    public function editPassword()
    {
        
        IS_POST && $this->jump($this->logicPersonnel->editPassword($this->param));
        
        $info = $this->logicPersonnel->getPersonnelInfo(['id' => MEMBER_ID]);
        
        $this->assign('info', $info);
        
        return $this->fetch('edit_password');
    }



    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Personnel', $this->param));
    }




    
}
